import sys,os
sys.path.append(os.pardir)
import numpy as np 
from common.functions import sigmoid,identity_function

# 输入层
X = np.array([1.0,0.5])
W1 = np.array([[0.1,0.3,0.5],[0.2,0.4,0.6]])
b1 = np.array([0.1,0.2,0.3])

a1 = np.dot(X,W1) + b1 # 输入层仿射变换
z1 = sigmoid(a1) # 输入层激活函数 (3,)
print(a1)
print(z1)

# 隐藏层计算
W2 = np.array([[0.1,0.4],[0.2,0.5],[0.3,0.6]])
b2 = np.array([0.1,0.2])

a2 = np.dot(z1,W2) + b2 # 隐藏层仿射变换
z2 = sigmoid(a2) # 隐藏层激活函数 （2,)

# 输出层计算
W3 = np.array([[0.1,0.3],[0.2,0.4]])
b3 = np.array([0.1,0.2])

a3 = np.dot(z2,W3) + b3
Y = identity_function(a3) # 输出层激活函数

